<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="template.xhtml" 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:define name="body">
	<f:metadata>
		<f:event type="preRenderView" listener="#{guvenlikDenetimi.erisimKontrol()}"></f:event>
	</f:metadata>
	
	<center>
	<h:form prependId="false">
		<p:panel style="margin-top:10px; width:50%">
			<p:commandButton value="Tüm Kullanıcıları Getir" ajax="false"
				actionListener="#{kullaniciAction.kullanicilariGetir}" />

			<p:messages />

			<p:dataTable id="tablo" var="kullanici"
				value="#{kullaniciAction.kullanicilar}" paginator="true" rows="10"
				paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
				rowsPerPageTemplate="5,10,15" 
				rendered="#{kullaniciAction.kullanicilar.size() > 0}">

				<f:facet name="header">Kullanıcı Listesi</f:facet>

				<p:column>
					<f:facet name="header">
						<h:outputText value="Ad" />
					</f:facet>
					<h:outputText value="#{kullanici.name}" />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="Soyad" />
					</f:facet>
					<h:outputText value="#{kullanici.surname}" />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="Yaş" />
					</f:facet>
					<h:outputText value="#{kullanici.age}" />
				</p:column>

				<p:column>
					<f:facet name="header">
						<h:outputText value="Ülke" />
					</f:facet>
					<h:outputText value="#{kullanici.country}" />
				</p:column>
			</p:dataTable>
		</p:panel>

	</h:form>
	</center>

</ui:define>
</ui:composition>